package com.study.controller;

import com.study.pojo.resp.ResultMessage;
import com.study.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/bus")
public class BusinessController {
    @Resource
    BusinessService businessService;

    //获取企业文化新闻
    //查询所有新闻
    @RequestMapping("/findAllBus")
    public ResultMessage findAllBus() {
        ResultMessage allNews = businessService.findAllBus();
        return allNews;
    }
    //根据新闻Id获取企业新闻
    @RequestMapping("/findNewsByIdBus/{newsId}")
    public ResultMessage findNewsByIdBus(@PathVariable("newsId")Integer newsId){
        return businessService.findNewsByIdBus(newsId);
    }
}
